﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace BlogApiTest
{
    /// <summary>
    /// 发送基类
    /// </summary>
    public class ReqBase
    {
        /// <summary>
        /// 方法名
        /// </summary>
        [JsonIgnore] //忽视
        public string MethodName { get; set; }

        /// <summary>
        /// 方法描述
        /// </summary>
        [JsonIgnore]
        public string MethodDesc { get; set; }

        /// <summary>
        /// 方法类型
        /// </summary>
        [JsonIgnore]
        public string MethodType { get; set; }
    }

    /// <summary>
    /// 接收基类
    /// </summary>
    public class ResBase
    {
        public bool Code { get; set; }
        public string Message { get; set; }
    }

    /// <summary>
    /// 获取Token
    /// </summary>
    public class ReqGetToken : ReqBase
    {
        /// <summary>
        /// 用户名
        /// </summary>
        public string userName { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        public string password { get; set; }
    }

    /// <summary>
    /// 获取Token
    /// </summary>
    public class ResGetToken : ResBase
    {
        public string Token { get; set; }
    }

    /// <summary>
    /// 获取文章列表
    /// </summary>
    public class ReqGetList : ReqBase
    {
    }

    /// <summary>
    /// 获取文章列表
    /// </summary>
    public class ResGetList : ResBase
    {
        public List<InfoBlog> Items { get; set; }

        public class InfoBlog
        {
            public int ID { get; set; }

            /// <summary>
            /// 用户名
            /// </summary>
            public string UserName { get; set; }

            /// <summary>
            /// 标题
            /// </summary>
            public string Title { get; set; }

            /// <summary>
            /// 内容
            /// </summary>
            public string Content { get; set; }

            /// <summary>
            /// 访问次数
            /// </summary>
            public int VisitCount { get; set; }

            /// <summary>
            /// 创建时间
            /// </summary>
            public DateTime DTCreate { get; set; }
        }
    }

    /// <summary>
    /// 新增文章
    /// </summary>
    public class ReqAddBlog : ReqBase
    {
        /// <summary>
        /// 用户名
        /// </summary>
        public string UserName { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 内容
        /// </summary>
        public string Content { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime DTCreate { get; set; }
    }

    /// <summary>
    /// 新增文章
    /// </summary>
    public class ResAddBlog : ResBase
    {

    }
}
